import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
import HomeView from "../views/HomeView.vue";

import { showNotify } from "vant";
const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/ai",
    name: "ai",
    component: () => import("../views/ai.vue"),
  }
];

const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL),
  history: createWebHashHistory(),
  routes,
});

router.beforeEach(async (to: any, from: any, next: any) => {
  document.title = "AI智能课件";
  console.log("路由", to.name);
  if (
    to.name != "about" &&
    to.name != "newpatriarchbinding" &&
    to.name != "newstudentbinding" &&
    to.name != "home"
  ) {
  }
  next();
});
router.afterEach((to: any, from: any) => { });

export default router;
